import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

export default defineConfig({
  plugins: [uni()],
  server: {
    port: 5173,
    host: '0.0.0.0',
    proxy: {
      // 会员中心后端代理，解决H5开发环境下的跨域问题
      '/vip': {
        target: 'http://localhost:8084',
        changeOrigin: true,
        // 不重写路径，保持 /vip 前缀，直接透传
        rewrite: (path) => path
      }
    }
  }
})
